﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Cn.Edwon.Web.Support;
using Cn.Cellula.Biz.Port;
using Cn.Edwon.Spring;

namespace Cn.Cellula.Website.Ws {
    public partial class _ProductMarket : PageSupport {
        protected void Page_Load(object sender, EventArgs e) {
            SaveProductMarket();
        }

        private void SaveProductMarket() {
            String pid = Request.QueryString["pid"];
            String mkeys = Request.QueryString["mk"];
            String bk = "[]";
            if (!String.IsNullOrEmpty(pid)) {
                String[] ml = (String.IsNullOrEmpty(mkeys))?new string[]{}:mkeys.Split(',');
                try {
                    BizFactory.Get<IProductBiz>().UpdateProductMarket(this.OwnerKey, pid, ml);
                    bk = "{\"msg\":\"操作完成\",\"url\":\"\"}";
                } catch (Exception ex) {
                    bk = "{\"msg\":\""+ex.Message+"\",\"url\":\"\"}";
                }
            } else {
                bk = "{\"msg\":\"参数丢失\",\"url\":\"\"}";
            }
            Response.Clear();
            Response.Write(bk);
        }

    }
}
